Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Storage account kind V2 not supported in Azure Stack #12256

Closed
viananth opened this issue Feb 18, 2020 · 2 comments · Fixed by #12265
Closed

Default Storage account kind V2 not supported in Azure Stack #12256

viananth opened this issue Feb 18, 2020 · 2 comments · Fixed by #12265
Assignees
Labels
Storage az storage
Milestone

Comments

@viananth
Copy link
Member

Describe the bug
The recent update to default Storage kind to V2 is breaking Azure Stack as we don’t support this.

To Reproduce
az storage account create -n testsa -g testrg --sku Standard_LRS --debug

Expected behavior
To be able to create a storage account without specifying the "kind".

Fix
Update "min_apiversion" to a higher version than "2017-10-01" in
https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/storage/_params.py#L157

Environment summary
Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)
Edge build
azure-cli 2.1.0

command-modules-nspkg 2.0.3
core 2.1.0
nspkg 3.0.4
telemetry 1.0.4

Windows
PowerShell/cmd

Additional context
PS C:\Users\Administrator.S31R0801-DVM> az storage account create -n testsa -g testrg --sku Standard_LRS --debug
Command arguments: ['storage', 'account', 'create', '-n', 'testsa', '-g', 'testrg', '--sku', 'Standard_LRS', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x033A8B28>, <function OutputProducer.on_global_arguments at 0x033FF858>, <function CLIQuery.on_global_arguments at 0x0341C6A8>]
Event: CommandInvoker.OnPreCommandTableCreate []
Installed command modules ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'deploymentmanager', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'kusto', 'lab', 'managedservices', 'maps', 'monitor', 'natgateway', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'security', 'servicebus', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'vm']
Loaded module 'acr' in 0.002 seconds.
Loaded module 'acs' in 0.001 seconds.
Loaded module 'advisor' in 0.001 seconds.
Loaded module 'ams' in 0.001 seconds.
Loaded module 'apim' in 0.002 seconds.
Loaded module 'appconfig' in 0.005 seconds.
Loaded module 'appservice' in 0.016 seconds.
Loaded module 'backup' in 0.001 seconds.
Loaded module 'batch' in 0.005 seconds.
Loaded module 'batchai' in 0.001 seconds.
Loaded module 'billing' in 0.001 seconds.
Loaded module 'botservice' in 0.002 seconds.
Loaded module 'cdn' in 0.002 seconds.
Loaded module 'cloud' in 0.003 seconds.
Loaded module 'cognitiveservices' in 0.002 seconds.
Loaded module 'configure' in 0.002 seconds.
Loaded module 'consumption' in 0.001 seconds.
Loaded module 'container' in 0.001 seconds.
Loaded module 'cosmosdb' in 0.003 seconds.
Loaded module 'deploymentmanager' in 0.001 seconds.
Loaded module 'dla' in 0.001 seconds.
Loaded module 'dls' in 0.001 seconds.
Loaded module 'dms' in 0.002 seconds.
Loaded module 'eventgrid' in 0.001 seconds.
Loaded module 'eventhubs' in 0.006 seconds.
Loaded module 'extension' in 0.002 seconds.
Loaded module 'feedback' in 0.001 seconds.
Loaded module 'find' in 0.002 seconds.
Loaded module 'hdinsight' in 0.004 seconds.
Loaded module 'interactive' in 0.001 seconds.
Loaded module 'iot' in 0.001 seconds.
Loaded module 'iotcentral' in 0.001 seconds.
Loaded module 'keyvault' in 0.008 seconds.
Loaded module 'kusto' in 0.001 seconds.
Loaded module 'lab' in 0.001 seconds.
Loaded module 'managedservices' in 0.001 seconds.
Loaded module 'maps' in 0.002 seconds.
Loaded module 'monitor' in 0.002 seconds.
Loaded module 'natgateway' in 0.003 seconds.
Loaded module 'netappfiles' in 0.001 seconds.
Loaded module 'network' in 0.045 seconds.
Loaded module 'policyinsights' in 0.002 seconds.
Loaded module 'privatedns' in 0.017 seconds.
Loaded module 'profile' in 0.003 seconds.
Loaded module 'rdbms' in 0.002 seconds.
Loaded module 'redis' in 0.002 seconds.
Loaded module 'relay' in 0.001 seconds.
Loaded module 'reservations' in 0.002 seconds.
Loaded module 'resource' in 0.011 seconds.
Loaded module 'role' in 0.007 seconds.
Loaded module 'search' in 0.001 seconds.
Loaded module 'security' in 0.004 seconds.
Loaded module 'servicebus' in 0.001 seconds.
Loaded module 'servicefabric' in 0.001 seconds.
Loaded module 'signalr' in 0.001 seconds.
Loaded module 'sql' in 0.001 seconds.
Loaded module 'sqlvm' in 0.001 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'storage' in 0.049 seconds.
Loaded module 'vm' in 0.026 seconds.
Loaded all modules in 0.274 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: 'C:\Users\Administrator.S31R0801-DVM.azure\cliextensions'
Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x03528270>]
az_command_data_logger : command args: storage account create -n {} -g {} --sku {} --debug
metadata file logging enabled - writing logs to 'C:\Users\Administrator.S31R0801-DVM.azure\commands'.
Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x03567150>]
Event: CommandLoader.OnLoadArguments []
Event: CommandInvoker.OnPostArgumentLoad []
Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x03567390>, <function register_cache_arguments..add_cache_arguments at 0x03567468>]
Event: CommandInvoker.OnCommandTableLoaded []
Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x039FE1E0>]
Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x033FF8A0>, <function CLIQuery.handle_query_parameter at 0x0341C6F0>, <function register_ids_argument..parse_ids_arguments at 0x035673D8>, <function handler at 0x03A566F0>]
Getting management service client client_type=ResourceManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
attempting to read file C:\Users\Administrator.S31R0801-DVM.azure\accessTokens.json as utf-8-sig
adal-python : 81a76efe-384f-4d79-9ad5-5acef706d404 - Authority:Performing instance discovery: ...
adal-python : 81a76efe-384f-4d79-9ad5-5acef706d404 - Authority:Performing static instance discovery
adal-python : 81a76efe-384f-4d79-9ad5-5acef706d404 - Authority:Authority validated via static instance discovery
adal-python : 81a76efe-384f-4d79-9ad5-5acef706d404 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : 81a76efe-384f-4d79-9ad5-5acef706d404 - CacheDriver:finding with query keys: {'_clientId': '...', 'userId': '...'}
adal-python : 81a76efe-384f-4d79-9ad5-5acef706d404 - CacheDriver:Looking for potential cache entries: {'_clientId': '...', 'userId': '...'}
adal-python : 81a76efe-384f-4d79-9ad5-5acef706d404 - CacheDriver:Found 1 potential entries.
adal-python : 81a76efe-384f-4d79-9ad5-5acef706d404 - CacheDriver:Resource specific token found.
adal-python : 81a76efe-384f-4d79-9ad5-5acef706d404 - CacheDriver:Returning token from cache lookup, AccessTokenId: b'pn0ysZCysxjHJpy54fU/nWcuwd07X5d+7HVDVBoPw9s=', RefreshTokenId: b'7upKiF8MieVyzzdNktuF8u5Yyiep9sw6vqbIiDbXOTQ='
msrest.http_logger : Request URL: 'https://management.redmond.ext-s31r0801.masd.stbtest.microsoft.com/subscriptions/eba7a1b1-d526-4434-9973-8502212aa392/resourcegroups/testrg?api-version=2018-05-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger : 'Accept': 'application/json'
msrest.http_logger : 'accept-language': 'en-US'
msrest.http_logger : 'User-Agent': 'python/3.7.0 (Windows-10-10.0.17763-SP0) msrest/0.6.11 msrest_azure/0.6.2 azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.1.0'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.universal_http : Configuring redirects: allow=True, max=30
msrest.universal_http : Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http : Configuring proxies: ''
msrest.universal_http : Evaluate proxies against ENV settings: True
urllib3.connectionpool : Starting new HTTPS connection (1): management.redmond.ext-s31r0801.masd.stbtest.microsoft.com:443
urllib3.connectionpool : https://management.redmond.ext-s31r0801.masd.stbtest.microsoft.com:443 "GET /subscriptions/eba7a1b1-d526-4434-9973-8502212aa392/resourcegroups/testrg?api-version=2018-05-01 HTTP/1.1" 200 166
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger : 'Cache-Control': 'no-cache'
msrest.http_logger : 'Pragma': 'no-cache'
msrest.http_logger : 'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger : 'Expires': '-1'
msrest.http_logger : 'x-ms-ratelimit-remaining-subscription-reads': '14995'
msrest.http_logger : 'x-ms-request-id': '470f9950-4a97-4349-af2d-d89283bb2f62'
msrest.http_logger : 'x-ms-correlation-request-id': '470f9950-4a97-4349-af2d-d89283bb2f62'
msrest.http_logger : 'x-ms-routing-request-id': 'REDMOND:20200218T221509Z:470f9950-4a97-4349-af2d-d89283bb2f62'
msrest.http_logger : 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger : 'X-Content-Type-Options': 'nosniff'
msrest.http_logger : 'Date': 'Tue, 18 Feb 2020 22:15:09 GMT'
msrest.http_logger : 'Content-Length': '166'
msrest.http_logger : Response content:
msrest.http_logger : {"id":"/subscriptions/eba7a1b1-d526-4434-9973-8502212aa392/resourceGroups/testrg","name":"testrg","location":"redmond","properties":{"provisioningState":"Succeeded"}}
using location 'redmond' from resource group 'testrg'
Getting management service client client_type=StorageManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
Getting management service client client_type=StorageManagementClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
adal-python : 27d76706-4948-4f53-b5f7-a4b7348712f5 - Authority:Performing instance discovery: ...
adal-python : 27d76706-4948-4f53-b5f7-a4b7348712f5 - Authority:Performing static instance discovery
adal-python : 27d76706-4948-4f53-b5f7-a4b7348712f5 - Authority:Authority validated via static instance discovery
adal-python : 27d76706-4948-4f53-b5f7-a4b7348712f5 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : 27d76706-4948-4f53-b5f7-a4b7348712f5 - CacheDriver:finding with query keys: {'_clientId': '...', 'userId': '...'}
adal-python : 27d76706-4948-4f53-b5f7-a4b7348712f5 - CacheDriver:Looking for potential cache entries: {'_clientId': '...', 'userId': '...'}
adal-python : 27d76706-4948-4f53-b5f7-a4b7348712f5 - CacheDriver:Found 1 potential entries.
adal-python : 27d76706-4948-4f53-b5f7-a4b7348712f5 - CacheDriver:Resource specific token found.
adal-python : 27d76706-4948-4f53-b5f7-a4b7348712f5 - CacheDriver:Returning token from cache lookup, AccessTokenId: b'pn0ysZCysxjHJpy54fU/nWcuwd07X5d+7HVDVBoPw9s=', RefreshTokenId: b'7upKiF8MieVyzzdNktuF8u5Yyiep9sw6vqbIiDbXOTQ='
msrest.http_logger : Request URL: 'https://management.redmond.ext-s31r0801.masd.stbtest.microsoft.com/subscriptions/eba7a1b1-d526-4434-9973-8502212aa392/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/testsa?api-version=2017-10-01'
msrest.http_logger : Request method: 'PUT'
msrest.http_logger : Request headers:
msrest.http_logger : 'Accept': 'application/json'
msrest.http_logger : 'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger : 'accept-language': 'en-US'
msrest.http_logger : 'Content-Length': '128'
msrest.http_logger : 'User-Agent': 'python/3.7.0 (Windows-10-10.0.17763-SP0) msrest/0.6.11 msrest_azure/0.6.2 azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0'
msrest.http_logger : Request body:
msrest.http_logger : {"sku": {"name": "Standard_LRS"}, "kind": "StorageV2", "location": "redmond", "properties": {"supportsHttpsTrafficOnly": false}}
msrest.universal_http : Configuring redirects: allow=True, max=30
msrest.universal_http : Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http : Configuring proxies: ''
msrest.universal_http : Evaluate proxies against ENV settings: True
urllib3.connectionpool : Starting new HTTPS connection (1): management.redmond.ext-s31r0801.masd.stbtest.microsoft.com:443
urllib3.connectionpool : https://management.redmond.ext-s31r0801.masd.stbtest.microsoft.com:443 "PUT /subscriptions/eba7a1b1-d526-4434-9973-8502212aa392/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/testsa?api-version=2017-10-01 HTTP/1.1" 400 155
msrest.http_logger : Response status: 400
msrest.http_logger : Response headers:
msrest.http_logger : 'Cache-Control': 'no-cache'
msrest.http_logger : 'Pragma': 'no-cache'
msrest.http_logger : 'Content-Length': '155'
msrest.http_logger : 'Content-Type': 'text/plain; charset=utf-8'
msrest.http_logger : 'Expires': '-1'
msrest.http_logger : 'x-ms-correlation-request-id': 'c60bb869-5cfa-4b80-945f-912d63e5c6ea'
msrest.http_logger : 'Server': 'Microsoft-HTTPAPI/2.0'
msrest.http_logger : 'WWW-Authenticate': 'oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvBOjFUjocNHLZqlYkgC6e4La8zmgrUlcTmsMNkikCGVkpI16crLLAQxfy5F8kwwjiaAQfBkpQUzh8HTbPjkbBs1LBjU2lYF7uDeVJaNtB9u1YM9w6frhhCUy9dWDfrvuxzCwwPM6XmHlJHK+31HxC'
msrest.http_logger : 'x-ms-ratelimit-remaining-subscription-writes': '1195'
msrest.http_logger : 'x-ms-request-id': 'c60bb869-5cfa-4b80-945f-912d63e5c6ea'
msrest.http_logger : 'x-ms-routing-request-id': 'REDMOND:20200218T221509Z:c60bb869-5cfa-4b80-945f-912d63e5c6ea'
msrest.http_logger : 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger : 'X-Content-Type-Options': 'nosniff'
msrest.http_logger : 'Date': 'Tue, 18 Feb 2020 22:15:09 GMT'
msrest.http_logger : Response content:
msrest.http_logger : {
"code": "StorageAccountInvalidKind",
"message": "The requested storage account kind is invalid in this location.",
"target": "StorageAccount"
}
msrest.exceptions : Cannot deserialize content-type: text/plain
msrest.exceptions : Operation failed with status: 'Bad Request'. Details: The requested storage account kind is invalid in this location.
cli.azure.cli.core.util : Operation failed with status: 'Bad Request'. Details: The requested storage account kind is invalid in this location.
Operation failed with status: 'Bad Request'. Details: The requested storage account kind is invalid in this location.
az_command_data_logger : exit code: 1
Suppress exception Module use of python35.dll conflicts with this version of Python.
command ran in 1.208 seconds.
PS C:\Users\Administrator.S31R0801-DVM>

@Juliehzl Juliehzl added the Storage az storage label Feb 19, 2020
@Juliehzl Juliehzl self-assigned this Feb 19, 2020
@Juliehzl
Copy link
Contributor

Hi @viananth, may I know which profile is used for your Azure Stack? We have such min_api constraint which is following https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_storage_management_client_enums.py#L39.

And for server side, v2017-10-01 should already support storagev2. Does your Azure Stack support storage api version v2017-10-01? If not, I think you should switch to other profile for azure cli, e.g. 2018-03-01-hybrid.
To switch the profile in azure cli, you can use az cloud set command.

@yonzhan yonzhan added this to the S166 milestone Feb 19, 2020
@viananth
Copy link
Member Author

@Juliehzl The 2019-03-01-hybrid profile was crafted especially for Azure Stack with the promise of no breaking changes within a profile. Though Azure Stack has moved to support 2017-10-01 for Storage mgmt, not all features are supported in this API.
You can use this profile map to verify the latest versions supported by azure stack: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/profile/2019-03-01-hybrid.json

@bganapa for FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage az storage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants