-
Notifications
You must be signed in to change notification settings - Fork 405
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
[Modules] Extend Microsoft.Sql\servers
with administrators
child resource
#2430
Comments
Microsoft.Sql\servers
with administrators
child resourceMicrosoft.Sql\servers
with administrators
child resource
Hey @bryansan-msft , |
There is already an I'm I right, that this can be set up only at server creation, and your issue is that in order to be able to modify administrators after creation, we'd need a separate module for that? |
Hey @peterbud,
However, as per your statement, I presume this will not necessarily be an option for the SQL-Sever module, correct? I'm basing this statement on the sentence 'can be set up only at server creation'. Looking forward to your thoughts on the matter :) |
Hi @AlexanderSehr , I have checked, and the server's |
I have spent more time to understand this specific It seems that at the creation of a server you MUST use one of the two inline properties:
If you don't use one of the two above you cannot create a server, even when you supply the same data at the child More you can read also at the Bicep issue here So it seems to me that the So if the above is true: does it make sense to create these child resources, knowing that they could be only used in a standalone way? |
Hey @peterbud, |
Ok, let's tag it with a long term label. |
Wanted to throw in a comment that i'm using this module for SQL server deployment and I came across the issue of not being able to update EntraID administrators for an existing deployment. That led me to discovering you have to use the server/administrators child resource to update an existing adminstrators property on a SQL server. I was sad to see the SQL Server module only uses the parent It looks like the properties for the child module are identical to the parent Is it possible to use some kind of logc within the module to see if this is a new or existing deployment? if deployment = |
@tony-box : let me see how I can achieve that, I think that would be a good solution. |
@AlexanderSehr a little help would be needed here. I have combed through the repo, and I could not find an example where the module would detect / differentiate between new deployment and deployment updates. The closest I have found was this "upsert" module, but that would mean the input to decide whether to do a create or update deployment would come from the external source as a parameter, and that would be not useful here. Do you know any example how this can be achieved which we could use here for such differentiation? |
Hey @peterbud, If it does not work in an idempontent way, it 'should' be considered a provider bug and be raised as such. And just to put the icing on the cake, I recently learned of another provider that was suprised that the concept of 'idempotency' should apply to IaC templates. While the PG 'fixes' the issue (if you happen to create a bug item for this), an intermediate, be it ugly, solution would be to implement a toggle the consumer of the module could set to tell the module it's not deploying for the first time. But as we can I guess all agree, this is just working around the issue and also provides a bad user experience. |
Many thanks @AlexanderSehr for the quick reply. Also I have found this issue, which has ben open since 2021 (!) on the very same subject, concluding with the same outcome: the API is not idempotent currently, and all the opened issues to PG has been dismissed so far. So I'm afraid we'll stuck with the current setup: only the server resource can set this property in an idempotent way (and hence no update), and no update via the child |
Create a new child module for the
Microsoft.Sql/servers/administrators
resource type as per the service documentation and our contribution guide.The text was updated successfully, but these errors were encountered: