How to run scheduled Azure SQL Procedure

How to run scheduled Azure SQL Procedure
Azure Automation with runbook

1.Problem

Azure Managed SQL 에서는 설치형 MSSQL DB와 달리 스케줄 잡을 실행할 수 없습니다.

참고: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/job-automation-managed-instance?view=azuresql

2.Solution

Azure Automation AccountPowerShell 로 DB Procedure 실행하는 Job을 등록해서 매일 특정시간에 동작하게 하면 됩니다. 이 외에도 Azure Function을 만들어 주기적으로 실행하는 방법도 있지만 Microsoft 제품인 만큼 생산성을 위해 파워셸을 사용해 간단한 코드로 해결하였습니다.

Write-Output "Run started"

# Instantiate the connection to the SQL Database

$sqlConnection = new-object System.Data.SqlClient.SqlConnection


$sqlConnection.ConnectionString = "Data Source=servername.database.windows.net;Initial Catalog=database;Integrated Security=False;User ID=userid;Password=password;Connect Timeout=60;Encrypt=False;TrustServerCertificate=False"


$sqlConnection.Open()


Write-Output "Azure SQL database connection opened"


# Define the SQL command to run

$sqlCommand = new-object System.Data.SqlClient.SqlCommand

$sqlCommand.CommandTimeout = 120

$sqlCommand.Connection = $sqlConnection


Write-Output "Issuing command to run stored procedure"


# Execute the SQL command

$sqlCommand.CommandText= 'exec [dbo].[storedProcedure]'

$result = $sqlCommand.ExecuteNonQuery()


Write-Output "Stored procedure execution completed"


# Close the SQL connection

$sqlConnection.Close()


Write-Output "Run completed"

참고: https://global.hitachi-solutions.com/blog/azure-sql-databases-stored-procedure/

Read more

Lumen - AI Agent를 위한 지속 가능한 두뇌

Lumen - AI Agent를 위한 지속 가능한 두뇌

왜 만들었는가 AI 에이전트는 모든 대화를 기억상실증 상태에서 시작합니다. Claude Code, Cursor, Codex, Mastra 하네스, LangChain 파이프라인 — 이 도구들은 세상을 알지만 당신의 세상은 전혀 모릅니다. 당신이 읽은 200편의 논문, 당신이 출시하는 코드베이스, 지난 분기에 내린 아키텍처 결정, 새벽 2시에 그 버그를 잡아냈을 때 마침내 통했던 트래젝토리. 모든 세션이 같은 컨텍스트를

By Sardor Madaminov

200 OK, 텅 빈 body — Starlette Race Condition 장애 분석기

발생일: 2026-04-23 / 해결일: 2026-04-27 영향 범위: report-dev.machine365.ai 전체 API 들어가며 API가 200 OK를 반환하는데 body가 비어있다. 프론트엔드에는 아무것도 안 뜨고, Swagger UI(/docs)도 빈 화면. 그런데 로컬에서 돌리면 멀쩡하다. 배경은 이랬다. 미터링(Metering) 기능을 만들면서 API 호출 로그를 수집할 미들웨어를 작성했다. Spring Boot 백엔드에 먼저 적용하고, Python

By Jeonggil