Skip to content

[Storage] support Key/saspolicy in Create/Update account #14741

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

Merged
merged 3 commits into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.ApplicationInsights" Version="0.3.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="19.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="21.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/EventGrid/EventGrid.Test/EventGrid.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.7.0" />
<PackageReference Include="Microsoft.Azure.Management.Relay" Version="2.0.2" />
<PackageReference Include="Microsoft.Azure.Management.ServiceBus" Version="2.1.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="19.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="21.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/IotHub/IotHub.Test/IotHub.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.0" />
<PackageReference Include="Microsoft.Azure.Management.EventHub" Version="2.7.0" />
<PackageReference Include="Microsoft.Azure.Management.IotHub" Version="3.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="19.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="21.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Network/Network.Test/Network.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PackageReference Include="Microsoft.Azure.Management.Redis" Version="4.4.1" />
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.21.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.10.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="19.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="21.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.21.0-preview" />
<PackageReference Include="Microsoft.Azure.OperationalInsights" Version="0.10.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="19.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="21.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@
"StatusCode": 201
},
{
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/checkNameAvailability?api-version=2021-01-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9jaGVja05hbWVBdmFpbGFiaWxpdHk/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==",
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/checkNameAvailability?api-version=2021-02-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9jaGVja05hbWVBdmFpbGFiaWxpdHk/YXBpLXZlcnNpb249MjAyMS0wMi0wMQ==",
"RequestMethod": "POST",
"RequestBody": "{\r\n \"name\": \"azpstestaccountmock1\",\r\n \"type\": \"Microsoft.Storage/storageAccounts\"\r\n}",
"RequestHeaders": {
Expand Down Expand Up @@ -386,8 +386,8 @@
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/checkNameAvailability?api-version=2021-01-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9jaGVja05hbWVBdmFpbGFiaWxpdHk/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==",
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/checkNameAvailability?api-version=2021-02-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9jaGVja05hbWVBdmFpbGFiaWxpdHk/YXBpLXZlcnNpb249MjAyMS0wMi0wMQ==",
"RequestMethod": "POST",
"RequestBody": "{\r\n \"name\": \"azpstestaccountmock2\",\r\n \"type\": \"Microsoft.Storage/storageAccounts\"\r\n}",
"RequestHeaders": {
Expand Down Expand Up @@ -455,8 +455,8 @@
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock1?api-version=2021-01-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2sxP2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=",
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock1?api-version=2021-02-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2sxP2FwaS12ZXJzaW9uPTIwMjEtMDItMDE=",
"RequestMethod": "PUT",
"RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\"\r\n },\r\n \"kind\": \"StorageV2\",\r\n \"location\": \"East US\"\r\n}",
"RequestHeaders": {
Expand Down Expand Up @@ -487,7 +487,7 @@
"no-cache"
],
"Location": [
"https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/be97bb47-8892-4065-92aa-d764724f60f8?monitor=true&api-version=2021-01-01"
"https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/be97bb47-8892-4065-92aa-d764724f60f8?monitor=true&api-version=2021-02-01"
],
"Retry-After": [
"17"
Expand Down Expand Up @@ -530,8 +530,8 @@
"StatusCode": 202
},
{
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/be97bb47-8892-4065-92aa-d764724f60f8?monitor=true&api-version=2021-01-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9sb2NhdGlvbnMvZWFzdHVzL2FzeW5jb3BlcmF0aW9ucy9iZTk3YmI0Ny04ODkyLTQwNjUtOTJhYS1kNzY0NzI0ZjYwZjg/bW9uaXRvcj10cnVlJmFwaS12ZXJzaW9uPTIwMjEtMDEtMDE=",
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/be97bb47-8892-4065-92aa-d764724f60f8?monitor=true&api-version=2021-02-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9sb2NhdGlvbnMvZWFzdHVzL2FzeW5jb3BlcmF0aW9ucy9iZTk3YmI0Ny04ODkyLTQwNjUtOTJhYS1kNzY0NzI0ZjYwZjg/bW9uaXRvcj10cnVlJmFwaS12ZXJzaW9uPTIwMjEtMDItMDE=",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
Expand Down Expand Up @@ -587,8 +587,8 @@
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock1?api-version=2021-01-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2sxP2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=",
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock1?api-version=2021-02-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2sxP2FwaS12ZXJzaW9uPTIwMjEtMDItMDE=",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
Expand Down Expand Up @@ -650,8 +650,8 @@
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock2?api-version=2021-01-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2syP2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=",
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock2?api-version=2021-02-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2syP2FwaS12ZXJzaW9uPTIwMjEtMDItMDE=",
"RequestMethod": "PUT",
"RequestBody": "{\r\n \"sku\": {\r\n \"name\": \"Standard_LRS\"\r\n },\r\n \"kind\": \"StorageV2\",\r\n \"location\": \"East US\"\r\n}",
"RequestHeaders": {
Expand Down Expand Up @@ -682,7 +682,7 @@
"no-cache"
],
"Location": [
"https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/355b5a7c-6991-4f35-9bac-e5d358452b50?monitor=true&api-version=2021-01-01"
"https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/355b5a7c-6991-4f35-9bac-e5d358452b50?monitor=true&api-version=2021-02-01"
],
"Retry-After": [
"17"
Expand Down Expand Up @@ -725,8 +725,8 @@
"StatusCode": 202
},
{
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/355b5a7c-6991-4f35-9bac-e5d358452b50?monitor=true&api-version=2021-01-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9sb2NhdGlvbnMvZWFzdHVzL2FzeW5jb3BlcmF0aW9ucy8zNTViNWE3Yy02OTkxLTRmMzUtOWJhYy1lNWQzNTg0NTJiNTA/bW9uaXRvcj10cnVlJmFwaS12ZXJzaW9uPTIwMjEtMDEtMDE=",
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.Storage/locations/eastus/asyncoperations/355b5a7c-6991-4f35-9bac-e5d358452b50?monitor=true&api-version=2021-02-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9sb2NhdGlvbnMvZWFzdHVzL2FzeW5jb3BlcmF0aW9ucy8zNTViNWE3Yy02OTkxLTRmMzUtOWJhYy1lNWQzNTg0NTJiNTA/bW9uaXRvcj10cnVlJmFwaS12ZXJzaW9uPTIwMjEtMDItMDE=",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
Expand Down Expand Up @@ -782,8 +782,8 @@
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock2?api-version=2021-01-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2syP2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=",
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock2?api-version=2021-02-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2syP2FwaS12ZXJzaW9uPTIwMjEtMDItMDE=",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
Expand Down Expand Up @@ -1298,8 +1298,8 @@
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock1?api-version=2021-01-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2sxP2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=",
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock1?api-version=2021-02-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2sxP2FwaS12ZXJzaW9uPTIwMjEtMDItMDE=",
"RequestMethod": "DELETE",
"RequestBody": "",
"RequestHeaders": {
Expand Down Expand Up @@ -1361,8 +1361,8 @@
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock2?api-version=2021-01-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2syP2FwaS12ZXJzaW9uPTIwMjEtMDEtMDE=",
"RequestUri": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/ps9940/providers/Microsoft.Storage/storageAccounts/azpstestaccountmock2?api-version=2021-02-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOWUyMjNkYmUtMzM5OS00ZTE5LTg4ZWItMDk3NWYwMmFjODdmL3Jlc291cmNlR3JvdXBzL3BzOTk0MC9wcm92aWRlcnMvTWljcm9zb2Z0LlN0b3JhZ2Uvc3RvcmFnZUFjY291bnRzL2F6cHN0ZXN0YWNjb3VudG1vY2syP2FwaS12ZXJzaW9uPTIwMjEtMDItMDE=",
"RequestMethod": "DELETE",
"RequestBody": "",
"RequestHeaders": {
Expand Down
2 changes: 1 addition & 1 deletion src/Search/Search.Test/Search.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Search" Version="4.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="19.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="21.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ public void TestNewSetAzureStorageAccountAllowSharedKeyAccess()
public void TestNewAzureStorageAccountEdgeZone()
{
TestRunner.RunTestScript("Test-NewAzureStorageAccountEdgeZone");
}
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAzureStorageAccountKeySASPolicy()
{
TestRunner.RunTestScript("Test-AzureStorageAccountKeySASPolicy");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1595,4 +1595,61 @@ function Test-NewAzureStorageAccountEdgeZone
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Test Test-AzureStorageAccountKeySASPolicy
.DESCRIPTION
SmokeTest
#>
function Test-AzureStorageAccountKeySASPolicy
{
# Setup
$rgname = Get-StorageManagementTestResourceName;

try
{
# Test
$stoname = 'sto' + $rgname;
$stotype = 'Standard_LRS';
$loc = Get-ProviderLocation ResourceManagement;
$kind = 'StorageV2'
$keyExpirationPeriodInDay = 5
$sasExpirationPeriod = "1.12:05:06"

New-AzResourceGroup -Name $rgname -Location $loc;
Write-Output ("Resource Group created")

# new account
New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -SkuName $stotype -KeyExpirationPeriodInDay $keyExpirationPeriodInDay -SasExpirationPeriod $sasExpirationPeriod

Retry-IfException { $global:sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname; }
Assert-AreEqual $stoname $sto.StorageAccountName;
Assert-AreEqual $stotype $sto.Sku.Name;
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
Assert-AreEqual $kind $sto.Kind;
Assert-AreEqual $keyExpirationPeriodInDay $sto.KeyPolicy.KeyExpirationPeriodInDays;
Assert-AreEqual $sasExpirationPeriod $sto.SasPolicy.SasExpirationPeriod;
Assert-NotNull $sto.KeyCreationTime.Key1
Assert-NotNull $sto.KeyCreationTime.Key2

# update account
$keyExpirationPeriodInDay = 3
$sasExpirationPeriod = "50.00:00:00"
Set-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -KeyExpirationPeriodInDay $keyExpirationPeriodInDay -SasExpirationPeriod $sasExpirationPeriod -EnableHttpsTrafficOnly $true

Retry-IfException { $global:sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname; }
Assert-AreEqual $keyExpirationPeriodInDay $sto.KeyPolicy.KeyExpirationPeriodInDays;
Assert-AreEqual $sasExpirationPeriod $sto.SasPolicy.SasExpirationPeriod;
Assert-NotNull $sto.KeyCreationTime.Key1
Assert-NotNull $sto.KeyCreationTime.Key2

Remove-AzStorageAccount -Force -ResourceGroupName $rgname -Name $stoname;
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

Large diffs are not rendered by default.

Loading