Skip to content

[azure][LFO] Remove app service plan creation step in LFO script#49

Merged
agulen merged 2 commits into
mainfrom
altan/2510/rmasp
Oct 22, 2025
Merged

[azure][LFO] Remove app service plan creation step in LFO script#49
agulen merged 2 commits into
mainfrom
altan/2510/rmasp

Conversation

@agulen
Copy link
Copy Markdown
Member

@agulen agulen commented Oct 21, 2025

Overview

JIra

Problem

This is an odd issue.
When trying to create the app service plan for LFO's control plane in our log-forwarding-testing subscription, I would hit this error.
ERROR: Operation returned an invalid status 'Unauthorized'

This error does not happen when ran on azure-integrations-testing and I have Contributor permissions on both subscriptions.

The app service plan creation code was already using a previous workaround (GitHub issue) by utilizing az resource create instead of az appservice plan create. This was needed only for the Y1 ASP SKU (function app consumption plan), which is what LFO utilizes.

After some research, it turns out that some Azure resource providers on newer subscriptions disallow passing JSON straight into the provider in certain cases. I believe this is the case for the Y1 app function SKUs. So the Unauthorized error is not necessarily regarding my Azure permissions - it is likely the Azure provider throwing a HTTP 401/403 due to the JSON specifying a Y1 SKU being passed directly to the provider.

Fix

If multiple function apps are configured in the same resource group and region, then Azure will automatically slot them into a shared app service plan with the Y1 SKU. The only caveat is that you cannot control the name of the app service plan, which is fine in the case of LFO.

Testing

Manually tested. I repro'd the original issue in log-forwarding-testing, then confirmed that things still work as expected when the explicit ASP creation step is removed. Here is the auto-generated ASP.
The script works in that subscription now 👍

@agulen agulen requested a review from a team as a code owner October 21, 2025 20:39
@agulen agulen requested review from benjjs, gpalmz and pashneal and removed request for pashneal October 21, 2025 20:39
@agulen agulen changed the title [azure] Remove app service plan creation step in LFO script [azure][LFO] Remove app service plan creation step in LFO script Oct 21, 2025
@gpalmz
Copy link
Copy Markdown
Collaborator

gpalmz commented Oct 21, 2025

So the Unauthorized error is not necessarily regarding my Azure permissions - it is likely

The description seems to cut off here


from az_shared.az_cmd import AzCmd, execute
from az_shared.errors import ExistenceCheckError, FatalError, ResourceNotFoundError
from az_shared.errors import (
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I wonder why this is happening 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll double check some of my VS code settings - it might be me

@agulen
Copy link
Copy Markdown
Member Author

agulen commented Oct 21, 2025

So the Unauthorized error is not necessarily regarding my Azure permissions - it is likely

The description seems to cut off here

Updated, sorry about that

@agulen agulen merged commit fb309e7 into main Oct 22, 2025
1 check passed
@agulen agulen deleted the altan/2510/rmasp branch October 22, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants