@@ -18,6 +18,7 @@ import (
18
18
19
19
"github.com/Azure/azure-sdk-for-go/profiles/latest/frontdoor/mgmt/frontdoor"
20
20
"github.com/Azure/azure-sdk-for-go/profiles/latest/mysql/mgmt/mysql"
21
+ "github.com/Azure/azure-sdk-for-go/profiles/latest/privatedns/mgmt/privatedns"
21
22
"github.com/Azure/azure-sdk-for-go/profiles/latest/resources/mgmt/resources"
22
23
"github.com/Azure/azure-sdk-for-go/profiles/latest/sql/mgmt/sql"
23
24
"github.com/Azure/azure-sdk-for-go/profiles/preview/cosmos-db/mgmt/documentdb"
@@ -176,7 +177,7 @@ func CreateKeyVaultManagementClientE(subscriptionID string) (*kvmng.VaultsClient
176
177
return nil , err
177
178
}
178
179
179
- //create keyvault management clinet
180
+ // create keyvault management clinet
180
181
vaultClient := kvmng .NewVaultsClientWithBaseURI (baseURI , subscriptionID )
181
182
182
183
return & vaultClient , nil
@@ -220,7 +221,6 @@ func CreateStorageBlobContainerClientE(subscriptionID string) (*storage.BlobCont
220
221
221
222
blobContainerClient := storage .NewBlobContainersClientWithBaseURI (baseURI , subscriptionID )
222
223
authorizer , err := NewAuthorizer ()
223
-
224
224
if err != nil {
225
225
return nil , err
226
226
}
@@ -243,7 +243,6 @@ func CreateStorageFileSharesClientE(subscriptionID string) (*storage.FileSharesC
243
243
244
244
fileShareClient := storage .NewFileSharesClientWithBaseURI (baseURI , subscriptionID )
245
245
authorizer , err := NewAuthorizer ()
246
-
247
246
if err != nil {
248
247
return nil , err
249
248
}
@@ -693,7 +692,7 @@ func CreateLoadBalancerClientE(subscriptionID string) (*network.LoadBalancersCli
693
692
return nil , err
694
693
}
695
694
696
- //create LB client
695
+ // create LB client
697
696
client := network .NewLoadBalancersClientWithBaseURI (baseURI , subscriptionID )
698
697
return & client , nil
699
698
}
@@ -741,7 +740,6 @@ func CreateNewVirtualNetworkClientE(subscriptionID string) (*network.VirtualNetw
741
740
// CreateAppServiceClientE returns an App service client instance configured with the
742
741
// correct BaseURI depending on the Azure environment that is currently setup (or "Public", if none is setup).
743
742
func CreateAppServiceClientE (subscriptionID string ) (* web.AppsClient , error ) {
744
-
745
743
// Validate Azure subscription ID
746
744
subscriptionID , err := getTargetAzureSubscription (subscriptionID )
747
745
if err != nil {
@@ -762,7 +760,6 @@ func CreateAppServiceClientE(subscriptionID string) (*web.AppsClient, error) {
762
760
// CreateContainerRegistryClientE returns an ACR client instance configured with the
763
761
// correct BaseURI depending on the Azure environment that is currently setup (or "Public", if none is setup).
764
762
func CreateContainerRegistryClientE (subscriptionID string ) (* containerregistry.RegistriesClient , error ) {
765
-
766
763
// Validate Azure subscription ID
767
764
subscriptionID , err := getTargetAzureSubscription (subscriptionID )
768
765
if err != nil {
@@ -927,6 +924,35 @@ func CreateDataFactoriesClientE(subscriptionID string) (*datafactory.FactoriesCl
927
924
return & dataFactoryClient , nil
928
925
}
929
926
927
+ // CreatePrivateDnsZonesClientE is a helper function that will setup a private DNS zone client.
928
+ func CreatePrivateDnsZonesClientE (subscriptionID string ) (* privatedns.PrivateZonesClient , error ) {
929
+ // Validate Azure subscription ID
930
+ subID , err := getTargetAzureSubscription (subscriptionID )
931
+ if err != nil {
932
+ return nil , err
933
+ }
934
+
935
+ // Lookup environment URI
936
+ baseURI , err := getBaseURI ()
937
+ if err != nil {
938
+ return nil , err
939
+ }
940
+
941
+ // Create a private DNS zone client
942
+ privateZonesClient := privatedns .NewPrivateZonesClientWithBaseURI (baseURI , subID )
943
+
944
+ // Create an authorizer
945
+ authorizer , err := NewAuthorizer ()
946
+ if err != nil {
947
+ return nil , err
948
+ }
949
+
950
+ // Attach authorizer to the client
951
+ privateZonesClient .Authorizer = * authorizer
952
+
953
+ return & privateZonesClient , nil
954
+ }
955
+
930
956
func CreateManagedEnvironmentsClientE (subscriptionID string ) (* armappcontainers.ManagedEnvironmentsClient , error ) {
931
957
clientFactory , err := getArmAppContainersClientFactory (subscriptionID )
932
958
if err != nil {
0 commit comments