Change:
<!-- Please only use this template for submitting enhancement requests --What would you like to be : PR() already proves that old api-version on Azure stack works on global Azure too, we could support azure stack in azure cloud provider lib, and then make sure following components works in Azure stack: CSI drivers: azure disk, azure file CCM Since it's mainly api-version change, we could also add e2e tests against global Azure too. Why is this needed: /assign /priority important-soon /sig cloud-provider /area provider/azure
there is blocking issue here(also need azure stack supports latest data model struct): just making the change in interfaces and not go-sdk but facing this error, since we don't have a switch inside go-sdk, we only do switch in azure cloud provider lib,
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale

Discussion:
const ( // CloudProviderName is the value used for the --cloud-provider flag <del> CloudProviderName      = "azure" </del> <ins> CloudProviderName = "azure" // AzureStackCloudName is the cloud name of Azure Stack AzureStackCloudName    = "AZURESTACKCLOUD" </ins> rateLimitQPSDefault    = 1.0 rateLimitBucketDefault = 5 backoffRetriesDefault  = 6

func (az *Cloud) getAzureClientConfig(servicePrincipalToken *adal.ServicePrincipalToken) *azclients.ClientConfig { azClientConfig := &azclients.ClientConfig{ <ins> CloudName:               az.Config.Cloud, </ins> Location:                az.Config.Location, SubscriptionID:          az.Config.SubscriptionID, ResourceManagerEndpoint: az.Environment.ResourceManagerEndpoint,

(disk.ManagedDisk != nil && diskURI != "" && strings.EqualFold(*disk.ManagedDisk.ID, diskURI)) { // found the disk klog.V(2).Infof("azureDisk - detach disk: name %q uri %q", diskName, diskURI) <del> if strings.EqualFold(as.cloud.Environment.Name, "AZURESTACKCLOUD") { </del> <ins> if strings.EqualFold(as.cloud.Environment.Name, AzureStackCloudName) { </ins> disks = append(disks[:i], disks[i+1:]...) } else { disks[i].ToBeDetached = to.BoolPtr(true)

(disk.ManagedDisk != nil && diskURI != "" && strings.EqualFold(*disk.ManagedDisk.ID, diskURI)) { // found the disk klog.V(2).Infof("azureDisk - detach disk: name %q uri %q", diskName, diskURI) <del> if strings.EqualFold(ss.cloud.Environment.Name, "AZURESTACKCLOUD") { </del> <ins> if strings.EqualFold(ss.cloud.Environment.Name, AzureStackCloudName) { </ins> disks = append(disks[:i], disks[i+1:]...) } else { disks[i].ToBeDetached = to.BoolPtr(true)

// ClientConfig contains all essential information to create an Azure client. type ClientConfig struct { <ins> CloudName               string </ins> Location                string SubscriptionID          string ResourceManagerEndpoint string

"context" "fmt" "net/http" <ins> "strings" </ins> "time" "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"

func New(config *azclients.ClientConfig) *Client { baseURI := config.ResourceManagerEndpoint authorizer := config.Authorizer <del> armClient := armclient.New(authorizer, baseURI, config.UserAgent, APIVersion, config.Location, config.Backoff) </del> <ins> apiVersion := APIVersion if strings.EqualFold(config.CloudName, AzureStackCloudName) { apiVersion = AzureStackCloudAPIVersion } armClient := armclient.New(authorizer, baseURI, config.UserAgent, apiVersion, config.Location, config.Backoff) </ins> rateLimiterReader, rateLimiterWriter := azclients.NewRateLimiter(config.RateLimitConfig) klog.V(2).Infof("Azure StorageAccountClient (read ops) using rate limit config: QPS=%g, bucket=%d",

const ( // APIVersion is the API version for network. APIVersion = "2019-06-01" <ins> // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-02-01" // AzureStackCloudName is the cloud name of Azure Stack AzureStackCloudName = "AZURESTACKCLOUD" </ins> ) // Interface is the client interface for StorageAccounts.