You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a Sql Database, the database creation fails if there is an Azure policy defined to not allow databases to be created without elastic pool.
To Reproduce
Add and Assign an Azure policy to prevent database creation without elastic pool
Expectation is that the database will be created with the pool assigned.
Setup (please complete the following information):
Version: 1.38.0
Additional context
We discovered this with a service that creates database in Azure for customer environment provisioning. This prevents us from provisioning databases in a secure manner.
By comparing requests with PowerShell Az library, we identified that the issue is with the API version being used.
The Fluent library is using 2014-04-01 which seems to be ignoring the elastic pool name property in the create request, thus causing the policy to deny the request.
PowerShell is using the 2021-02-01-preview version, which causes the request to succeed.
Another difference is that the c# lib is sending elasticPoolName property, and PS is providing the full elasticPoolId. We tried substituting the property for the 2014-04-01 endpoint to send elasticPoolId, but the endpoint returns just a plain 400 (obvious as the elasticPoolId is not supported for 2014). We also tested this against different versions of API and it seems the pool assignment starts to work on/after 2017-03-01-preview.
The text was updated successfully, but these errors were encountered:
Describe the bug
When creating a Sql Database, the database creation fails if there is an Azure policy defined to not allow databases to be created without elastic pool.
To Reproduce
Code Snippet
Expected behavior
Expectation is that the database will be created with the pool assigned.
Setup (please complete the following information):
Additional context
We discovered this with a service that creates database in Azure for customer environment provisioning. This prevents us from provisioning databases in a secure manner.
By comparing requests with PowerShell Az library, we identified that the issue is with the API version being used.
The Fluent library is using
2014-04-01
which seems to be ignoring the elastic pool name property in the create request, thus causing the policy to deny the request.PowerShell is using the
2021-02-01-preview
version, which causes the request to succeed.Another difference is that the c# lib is sending
elasticPoolName
property, and PS is providing the fullelasticPoolId
. We tried substituting the property for the2014-04-01
endpoint to sendelasticPoolId
, but the endpoint returns just a plain 400 (obvious as theelasticPoolId
is not supported for 2014). We also tested this against different versions of API and it seems the pool assignment starts to work on/after2017-03-01-preview
.The text was updated successfully, but these errors were encountered: