Skip to content

Remove azureWebJobsStorage validation on deploy#3647

Merged
MicroFish91 merged 1 commit intomainfrom
mwf/homely-maroon
Apr 14, 2023
Merged

Remove azureWebJobsStorage validation on deploy#3647
MicroFish91 merged 1 commit intomainfrom
mwf/homely-maroon

Conversation

@MicroFish91
Copy link
Copy Markdown
Contributor

@MicroFish91 MicroFish91 commented Apr 14, 2023

Fixes #3638

As part of the Durable work, I introduced a remote resource/connection string validation pattern on deploy because these were required for netherite and sql backends. I went ahead and applied this pattern to storage to maintain consistency across the connection strings.

AFAICT, this was not being done before, and in adding this, I introduced an unintended consequence - see: #3638 (comment)
Basically, I was not aware of and did not take this into account: https://learn.microsoft.com/en-us/azure/azure-functions/functions-identity-based-connections-tutorial#edit-the-azurewebjobsstorage-configuration

Since we already connect storage accounts during Function App creation, it's probably not super necessary to do this validation anyway. I am removing azureWebJobsStorage validation on deploy to be consistent with how we used to things and to fix the above issue.

@MicroFish91 MicroFish91 requested a review from a team as a code owner April 14, 2023 08:59

// Supports validation on both 'debug' and 'deploy'
export async function validateStorageConnection(context: Omit<ISetConnectionSettingContext, 'projectPath'>, projectPath: string, options?: IConnectionPromptOptions): Promise<void> {
if (context.action === CodeAction.Deploy) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need even need this? validateStorageConnection never gets called in the deploy scenario anyway, right? I think it's only in pre-debugging.

Copy link
Copy Markdown
Contributor Author

@MicroFish91 MicroFish91 Apr 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, I wanted to add a guard in there so that it's extremely explicit, especially since the rest of the connection string validations use an update pattern that can happen in both debug or deploy

@MicroFish91 MicroFish91 merged commit 3b57517 into main Apr 14, 2023
@MicroFish91 MicroFish91 deleted the mwf/homely-maroon branch April 14, 2023 20:26
@microsoft microsoft locked and limited conversation to collaborators May 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AzureWebJobsStorage configuration setting is created on deployment, even when AzureWebJobsStorage__accountName already exists

2 participants